<template>
  <div>
    <h1>vuex数据{{ $store.state.vuexn }}</h1>
    我是副a组件
    <input type="text" v-model="val" @keydown.13="aBtn" />
  </div>
</template>
<style scoped>
</style>
<script>
import bus from "../bus";
export default {
  data() {
    return {
      val: "",
    };
  },
  created() {
    this.aBtn();
  },
  methods: {
    aBtn() {
      bus.$emit("send", this.val);
      this.$store.state.vuexn=this.val
      this.val = "";
    },
  },
};
</script>
